
define([
	'vue',
	'config',
	'common',
	'moment'
	],function(Vue,config,utils,moment){
	'use strict';

	var expensesRecord_revocationView=new Vue({
		el:'#app',
		data:{
			id:'',
			items:'',
		},
		filters:{
			moment:function(date){
				var Date = moment(date*1000).format('YYYY.MM.DD hh:mm');
				return Date;
			}
		},
		created:function(){
			utils.userToken();

			var _this = this;
			_this.id = utils.getQueryVariable('id');
			utils.ajax(utils.getWebUrl('declaration/get'),{
				id: _this.id
			},'POST',function(res){
				console.log(res)
				_this.items = res.data;	
			})
		},
		methods:{
			Delect:function(){
				var _this = this;
				utils.appAlert('确定撤销本次消费登记吗?',function(){
					utils.ajax(utils.getWebUrl('declaration/revoke'),{
						id: _this.id
					},'POST',function(res){
						utils.appAlert('撤销成功',function(res){
							window.location.href='expensesRecord_shop.html';
						})
					})
				},'确定',null,'取消')
				
			}
		}
	})

	return expensesRecord_revocationView;
});